package com.lyh.system.service.impl;

import java.util.List;
import com.lyh.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lyh.system.mapper.UserRebatesMapper;
import com.lyh.system.domain.UserRebates;
import com.lyh.system.service.IUserRebatesService;

/**
 * 用户报单返佣Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-01
 */
@Service
public class UserRebatesServiceImpl implements IUserRebatesService 
{
    @Autowired
    private UserRebatesMapper userRebatesMapper;

    /**
     * 查询用户报单返佣
     * 
     * @param id 用户报单返佣主键
     * @return 用户报单返佣
     */
    @Override
    public UserRebates selectUserRebatesById(Long id)
    {
        return userRebatesMapper.selectUserRebatesById(id);
    }

    /**
     * 查询用户报单返佣列表
     * 
     * @param userRebates 用户报单返佣
     * @return 用户报单返佣
     */
    @Override
    public List<UserRebates> selectUserRebatesList(UserRebates userRebates)
    {
        return userRebatesMapper.selectUserRebatesList(userRebates);
    }

    /**
     * 新增用户报单返佣
     * 
     * @param userRebates 用户报单返佣
     * @return 结果
     */
    @Override
    public int insertUserRebates(UserRebates userRebates)
    {
        userRebates.setCreateTime(DateUtils.getNowDate());
        return userRebatesMapper.insertUserRebates(userRebates);
    }

    /**
     * 修改用户报单返佣
     * 
     * @param userRebates 用户报单返佣
     * @return 结果
     */
    @Override
    public int updateUserRebates(UserRebates userRebates)
    {
        userRebates.setUpdateTime(DateUtils.getNowDate());
        return userRebatesMapper.updateUserRebates(userRebates);
    }

    /**
     * 批量删除用户报单返佣
     * 
     * @param ids 需要删除的用户报单返佣主键
     * @return 结果
     */
    @Override
    public int deleteUserRebatesByIds(Long[] ids)
    {
        return userRebatesMapper.deleteUserRebatesByIds(ids);
    }

    /**
     * 删除用户报单返佣信息
     * 
     * @param id 用户报单返佣主键
     * @return 结果
     */
    @Override
    public int deleteUserRebatesById(Long id)
    {
        return userRebatesMapper.deleteUserRebatesById(id);
    }
}
